package jcolorlinez;

import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.JFrame;

@SuppressWarnings("serial")
public class BoardFrame extends JFrame {
	ChessPanel[][] chessPanels = null;
	public BoardFrame(int rows, int cols) {
		setLayout(new GridLayout(rows, cols));
		chessPanels = new ChessPanel[rows][cols];
		for (int row=0; row<rows; row++) {
			for (int col=0; col<cols; col++) {
				chessPanels[row][col] = new ChessPanel(this, row, col);
				add(chessPanels[row][col]);
			}
		}
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setMinimumSize(new Dimension(400, 400));
		this.setTitle("Java Color Linez");
	}
}
